<?php

namespace App\Admin\Actions\Post;

use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;

class AuditFail extends RowAction
{
    public $name = '审核拒绝';

    public function handle(Model $model)
    {
        $model->merchant_status = 2;
        $model->save();
        \DB::table('subsidy')->where('uid', $model->id)->where('status', 0)->delete();
        \DB::table('stores')->where('uid', $model->id)->where('status', 0)->delete();

        return $this->response()->success('操作成功')->refresh();
    }

}